package com.mlk.bet.listener;

import com.mlk.bet.service.BetService;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 抽奖数据刷新
 */
@Component
public class BetInitDataListener implements ApplicationListener<ContextRefreshedEvent> {

    @Resource
    private BetService betService;

    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        this.betService.refreshRedisCache();
    }
}
